package cn.skcks.consumerserver.service;

import cn.skcks.providerserver.service.TicketService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.stereotype.Service;

@Service // 放到 Spring 容器中
public class UserService {
	// 从 注册中心 获取 provider 提供的 ticket
	@Reference
	TicketService TICKET_SERVICE;

	public void buyTicket(){
		String ticket = TICKET_SERVICE.getTicket();

		System.out.println("在注册中心 获取的 ticket => " + ticket);
	}
}